<include file="public@header"/>
<style type="text/css">
    .pic-list li {
        margin-bottom: 5px;
    }
</style>


</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">       
		<li><a href="{:url('company/add')}">新建客户公司</a></li>
		<li><a href="{:url('company/index')}">客户公司列表</a></li>
        <li class="active"><a href="{:url('company/add')}">客户公司编辑</a></li>
    </ul>
    <form action="{:url('Company/editPost')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
    	<input type="hidden" name='id' value="{$result.id}">
        <div class="row">
            <div class="col-md-9">
                <table class="table table-bordered">
                    <tr>
                        <th>公司名称<span class="form-required">*</span></th>
                        <td>
                            <input class="form-control" type="text" name="post[company_name]"
                                   id="title" required value="{$result.company_name}" placeholder="请输入公司名称"/>
                        </td>
                    </tr>

                    <tr>
                        <th>公司电话<span class="form-required"></span></th>
                        <td>
                            <input class="form-control" type="text" name="post[company_mobile]"
                                   id="title" value="{$result.company_mobile}" placeholder="请输入公司电话"/>
                        </td>
                    </tr>

                    <tr>
                        <th width="100">邮寄地址<span class="form-required"></span></th>
                        <td>
                            <input class="form-control" type="text" style="width:400px;" value="{$result.company_mail_address}"
                                   placeholder="点击添加" onclick="address();" id='company_mail_address' name="post[company_mail_address] " 
                                   readonly/>
                           
                        </td>
                    </tr>
                   
                  
                    <tr>
                        <th>备注</th>
                        <td>
                            <script type="text/plain" id="content" name="post[company_desc]">{$result.company_desc}</script>
                        </td>
                    </tr>
                   
                    
                </table>
                <hook name="portal_admin_article_edit_view_main"/>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('EDIT')}</button>
                        <a class="btn btn-default" href="{:url('AdminArticle/index')}">{:lang('BACK')}</a>
                    </div>
                </div>
            </div>
            <div class="col-md-3">
                

                <hook name="portal_admin_article_edit_view_right_sidebar"/>
            </div>
        </div>
    </form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
    //编辑器路径定义
    var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
    $(function () {

        editorcontent = new baidu.editor.ui.Editor();
        editorcontent.render('content');
        try {
            editorcontent.sync();
        } catch (err) {
        }

        $('.btn-cancel-thumbnail').click(function () {
            $('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
            $('#thumbnail').val('');
        });

    });

    function address() {

        openIframeLayer("{:url('Company/address')}", '请选择地址', {
            area: ['700px', '400px'],
            btn: ['确定', '取消'],
            yes: function (index, layero) {

                var iframeWin          = window[layero.find('iframe')[0]['name']];
                var all = iframeWin.confirm();
                $.ajax({
                    'url':"{:url('company/address_name_select')}?sheng="+all.sheng+'&shi='+all.shi+'&qu='+all.qu,
                    'type':'get',
                    'dataType':'json',
                    success:function(data)
                    {  
                         $('#company_mail_address').val(data.data+all.company_mail_address);
                    }
                })
            
                layer.close(index); //如果设定了yes回调，需进行手工关闭
            }
        });
    }
</script>
</body>
</html>
